#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Jan  8 11:32:35 2019

@author: DELL
"""
import alldata
import matplotlib.pyplot as plt
import numpy as np
from sklearn.externals import joblib


model=joblib.load('./svm1_model.model')
result=[]
for i in range(len(alldata.engine)):
    result1=model.predict(alldata.engine[i])
    x=result1.tolist().index(1)
    result.append(x)

#np.set_printoptions(threshold=np.inf)
#print(np.array(result).shape)
#print(result)
#print(result1)
#print(result1.tolist().index(1))
"""
fig=plt.figure()
plt.plot(alldata.engine_cycles[-1],result1)
plt.locator_params(axis='x',nbins=15)
plt.grid()
plt.xlabel('Life cycles')
plt.ylabel('Engine state')
plt.legend()
plt.show()
"""
